const os = require("os");
module.exports = (options) => {
  let network = os.networkInterfaces();
  for (let [key, val] of Object.entries(network)) {
    let tempStr = `${key}:\n`;
    val.forEach((item) => {
      if (item.address === "::1" || item.address === "127.0.0.1") {
        tempStr = "";
      } else if (item.family.toLocaleLowerCase() === options.family) {
        tempStr = `${tempStr}  IP地址====> ${item.address}\n  MAC地址===> ${item.mac}\n  子网掩码==> ${item.netmask}`;
      }
    });
    tempStr && console.log(tempStr);
  }
};
